//package soot.we.android.callGraph;
//
//import java.util.HashMap;
//import java.util.HashSet;
//import java.util.Map;
//import java.util.Set;
//
//import soot.Body;
//import soot.SootClass;
//import soot.SootMethod;
//import soot.Unit;
//import soot.jimple.IdentityStmt;
//import soot.jimple.ReturnVoidStmt;
//
//
//
//public class AnalysisJimpleClass {
//	
//	private final Map<String, Set<AndroidMethod>> callbackWorklist = new HashMap<String, Set<AndroidMethod>>();
//	/**
//	 * Checks whether the given Soot method comes from a system class. If not,
//	 * it is added to the list of callback methods.
//	 * @param method The method to check and add
//	 * @param baseClass The base class (activity, service, etc.) to which this
//	 * callback method belongs
//	 */
//	private void checkAndAddMethod(SootMethod method, SootClass baseClass) {
//		AndroidMethod am = new AndroidMethod(method);
//		
//		// Do not call system methods
//		if (am.getClassName().startsWith("android.")
//				|| am.getClassName().startsWith("java."))
//			return;
//
//		// Skip empty methods
//		if (method.isConcrete() && isEmpty(method.retrieveActiveBody()))
//			return;
//			
//		boolean isNew;
//		if (this.callbackMethods.containsKey(baseClass.getName()))
//			isNew = this.callbackMethods.get(baseClass.getName()).add(am);
//		else {
//			Set<AndroidMethod> methods = new HashSet<AndroidMethod>();
//			isNew = methods.add(am);
//			this.callbackMethods.put(baseClass.getName(), methods);
//		}
//			
//		if (isNew)
//			if (this.callbackWorklist.containsKey(baseClass.getName()))
//					this.callbackWorklist.get(baseClass.getName()).add(am);
//			else {
//				Set<AndroidMethod> methods = new HashSet<AndroidMethod>();
//				isNew = methods.add(am);
//				this.callbackWorklist.put(baseClass.getName(), methods);
//			}
//	}
//
//	private boolean isEmpty(Body activeBody) {
//		for (Unit u : activeBody.getUnits())
//			if (!(u instanceof IdentityStmt || u instanceof ReturnVoidStmt))
//				return false;
//		return true;
//	}
//}
